package com.asman.vr.network

import androidx.annotation.Keep
import com.google.gson.Gson


@Keep
interface RequestBody {

    @Keep
    data class Code(val code: String)

    @Keep //type:0-发送登录验证码  1-绑手机号发送验证码
    data class PhoneNumber(val phoneNumber: String, val type: Int)

    @Keep
    data class PhoneAndCode(
        val phoneNumber: String,
        val smsCode: String,
        val withHiredInfo: Boolean = true//返回租户信息
    )

    @Keep
    data class BindPhone(val token: String, val phoneNumber: String, val smsCode: String)

    @Keep
    data class BindWX(val channelUserToken: String)

    @Keep
    data class CreateCharge(
        val channel: String, //小程序支付：wx_lite,支付宝APP：alipay
        val clientType: Int, //客户端类型，小程序（点点搭）10010，微信公众号(牛牛搭新家装)：10030，牛牛搭APP:10050
        val payment: Long, //自定义支金额	分
        val paymentId: Long//支付单id
    )

    @Keep
    data class UploadContractIDCard(
        val projectId: Long, //项目id
        val propertyType: Int, //房产证明类型0：房产证，1 购房合同
        val identityCardFrontImg: String, //身份证正面url
        val identityCardReverseImg: String, //身份证反面url
        val propertyImgs: List<String?>//房产证 图片数组
    )

    @Keep //银行转账凭证上传
    data class UploadBackPay(
        val tradeId: Long, //订单ID
        val paymentId: Long, //支付单ID
        val paymentStage: Int, //支付阶段
        val imgUrls: List<String> //转账凭证图片
    )

    @Keep//定制我家需求  表单提交
    data class UploadMyHomeCustom(
        val buildingName: String?,//楼盘名
        val customerName: String?,//客户姓名
        val sex: Int?,//性别
        val phone: String?,//联系方式
        val housePic: String?,//户型图
        val say: String?//说的话
    )

    @Keep//添加评论/添加回复
    data class AddComment(
//        公有参数
        val projectId: Long,//项目id
        val journalId: Long,//日志id
        var content: String,//内容
        val taskId: Long?,//任务id
        val reviewType: Long?,//1：新增评论，2：回复


        val replyId: Long?,//reviewType==2时 评论的id
        val replyUserId: Long?,//当前这条评论的用户id
        val reviewId: Long?,//回复一级评论的时候，这条评论的id  或者回 复二级评论时候他的一级评论的id

        val replyRole: Int?//被回复人的角色类型
        //新增一条评论
//        reviewType==1

        //回复一级评论
//        reviewType==2
//        reviewId
//        replyUserId
//        replyRole

        //回复-回复
        //       reviewType==2
//        reviewId
//        replyUserId
//        replyId
//        replyRole

    ) {
        //新增一条评论
        /**
         * @param projectId 项目id
         * @param journalId 日志id
         * @param content 内容
         * @param taskId 任务id
         */
        constructor(
            projectId: Long,//项目id
            journalId: Long,//日志id
            content: String,//内容
            taskId: Long?//任务id
        ) : this(projectId, journalId, content, taskId, 1, null, null, null, null)

        //回复一级评论
        constructor(
            projectId: Long,//项目id
            journalId: Long,//日志id
            content: String,//内容
            taskId: Long?,//任务id
            reviewId: Long?,//回复一级评论的时候，这条评论的id
            replyUserId: Long,//当前这条评论的用户id
            replyRole: Int?//被回复人的角色类型
        ) : this(projectId, journalId, content, taskId, 2, null, replyUserId, reviewId, replyRole)

        //回复 二级回复
        constructor(
            projectId: Long,//项目id
            journalId: Long,//日志id
            content: String,//内容
            taskId: Long?,//任务id
            reviewId: Long?,//一级评论的id
            replyId: Long?,//回复二级评论的时候，这条评论的id
            replyUserId: Long?,//当前这条评论的用户id
            replyRole: Int?//被回复人的角色类型
        ) : this(
            projectId,
            journalId,
            content,
            taskId,
            2,
            replyId,
            replyUserId,
            reviewId,
            replyRole
        )
    }

    @Keep
    data class AddScore(
            val projectId: Long?,//项目id
            val stageSerial: Int?,//阶段值
            val taskId: Long?,//任务id
            val journalId: Long? = null,//日志ID type==3日志 时需要
            val type: Int?,//类型 1.任务 2.阶段 3.日志 5.合同
            val scoreItems: List<ScoreItem>?,//评分项
            val tags: List<Long>?//选择的标签--id数组
    )

    @Keep
    data class ScoreItem(
        val scoreLevel: Int?,//评分 0-很差；1-一般；2-满意；3-超赞；4-完美
        //    TOTAL_SCORE(0, "总体满意度"),
        //    CONSTRUCTION_QUALITY(1, "施工质量"),
        //    SERVICE_ATTITUDE(2, "服务态度-服务沟通-配合度"),
        //    CIVILIZATION(3, "文明施工-场地整洁"),
        //    SITE_MANAGEMENT(5, "工地管理"),
        //    PROFESSIONAL_COMPETENCE(6, "专业度-专业能力"),
        //    MATERIALS_AMOUNT(7, "辅助用量"),
        //    DECORATION_EFFECT(8, "装修效果"),
        //    DESIGN_EFFECT(9, "设计效果"),
        //    DESIGN_SERVICE(10,"设计师服务态度")
        val targetType: Int
    )

    @Keep
    data class QueryTags(
        val targetType: Int?,//0.总评分 1.施工质量 2服务态度 3文明施工 4辅材用料
        val scoreLevel: Int?//0-很差；1-一般；2-满意；3-超赞；4-完美
    )

    /**
     * 主页面 方案列表筛选
     * {"prodChannel":"PC0001","sourceType":"HD0001","withAds":true,"buildingId":1000482,"bedroomNumType":0,"buildingAreaType":0,"budgetType":1,"styleIdSet":[4,7],"pageSize":20,ticket: "{"adEnd":false,"adStartPos":9,"smEnd":true,"smStartPos":11,"suggest":false}"}
     * {"adEnd":false,"adStartPos":9,"smEnd":true,"smStartPos":11,"suggest":false}
     */
    @Keep
    data class HomeDataFilterRequest(
        var buildingId: Long? = null,//热门楼盘ID
        var bedroomNumType: Long? = null,//户型ID
        var buildingAreaType: Long? = null,//面积ID
        var budgetType: Long? = null,//预算ID
        var styleIdSet: List<Long>? = null,
        var pageSize: Int? = null,
        var withAds: Boolean? = true,//是否返回搜索为空推荐的数据
        var ticket: String? = null,//分页--上一页返回的ticket数据
        var sourceType: String? = "HD0001",// 用 "HD0001¬"
        var prodChannel: String? = "PC0001"//用 "PC0001"
    )

    /*enum class QueryType(value: Int) {
        Hard(0),//硬装主材
        Soft(1),//软装家具
        Electrical(3),//电气设备
        Accessory(4)//人工辅材
    }*/

    //报价单获取数据入参
    @Keep
    class DecorateRequest(
        val schemeId: Long? = null,//方案ID
        hotspots: String? = null,
        val queryType: Int? = null,//0:硬装主材,1:软装家具,3:电气设备,4:人工辅材
        val spaceCodes: List<String>? = null,//空间code
        val workId: Long? = null//编辑过保存过的方案ID
    ) {
        var hotspots: Map<String, String>? = null//来自3D换搭

        init {
            try {
                this.hotspots = Gson().fromJson<Map<String, String>>(hotspots, Map::class.java)
            } catch (e: Exception) {
                this.hotspots = null
            }
        }
    }

    @Keep
    data class DecorateUpdateGoodsRequest(
        val provinceCode: String? = "330000",
        val cityCode: String? = "330100",
        val schemeId: Long? = null,
        val workId: Long? = null,
        val hotspots: Map<String, String>?,
        val goodsNotSelected: List<GoodsNotSelected>?
    ) {
        @Keep
        data class GoodsNotSelected(
            val spaceCode: String? = null,
            val name: String? = null,
            val list: ArrayList<Long>? = null
        )
    }

    @Keep
    data class BuildMyHomeRequestBody(
            var area: Int? = null,
            var budget: Long? = null,
            var buildingName: String? = null,
            var city: String? = null,
            var designerId: String? = null,
            var houseParams: HouseParams? = null,
            var layoutPic: String? = null,
            var source: Int? = 4,//Android 传4
            var styleId: Int? = null,
            var telephone: String? = null
    ) {
        @Keep
        data class HouseParams(
            var bathroomNum: Int? = null,//室
            var livingRoomNum: Int? = null,//厅
            var kitchenNum: Int? = null,//厨
            var bedroomNum: Int? = null//卫
        )
    }
}
